package com.fxm.controller;

import com.fxm.domain.Notice;
import com.fxm.returns.RespEntity;
import com.fxm.service.NoticeService;
import com.fxm.vo.param.NoticeParam;
import io.swagger.annotations.Api;
import java.util.List;

import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * <p>
 * 公告管理 前端控制器
 * </p>
 *
 * @author fxm
 * @since 2021-02-24
 */
@RestController
@RequestMapping("/notice")
@Slf4j
@Api(value = "公告管理", tags = "公告管理")
public class NoticeController {

    @Resource
    private NoticeService noticeService;

    @GetMapping("/list")
    @ApiOperation(value = "公告列表")
    public RespEntity<List<Notice>> noticeList() {
        RespEntity<List<Notice>> respEntity = noticeService.noticeList();
        return respEntity;
    }

    @PostMapping("/insert")
    @ApiOperation(value = "发布公告")
    public RespEntity insertNotice(@RequestBody NoticeParam noticeParam) {
        RespEntity respEntity = noticeService.insertNotice(noticeParam);
        return respEntity;
    }
}
